package com.ios.enums;
/**
*@Author:WenTao
*@Description:心理测试状态集
*@Date:11:01 2018/7/20
*/
public enum PsychologicalTestEnum {

    SUCCESS_SHOWTYPE(11,"展示测试类型成功")
    ,FAIL_SHOWTYPE(01,"展示测试类型失败")
    ,NULL_PARAM(02,"参数为空或不完整")
    ,NULL_TEST(03,"测试不存在")
    ,SUCCESS_SHOWTEST(12,"展示测试成功")
    ,FAIL_SHOWTEST(04,"展示测试失败")
    ,SUCCESS_SHOWQUESTION(13,"展示题目测试成功")
    ,FAIL_SHOWQUESTION(05,"展示测试题目失败")
    ,SUCCESS_RESULT(14,"测试结果生成成功")
    ,FAIL_RESULT(06,"测试结果生成失败")
    ,FAIL(07,"请回答所有题目");

    private int state;
    private String stateInfo;

    PsychologicalTestEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    /*根据传入的state返回对应的enum值*/
    public static PsychologicalTestEnum stateof(int state){
        for (PsychologicalTestEnum stateEnum : values()){
            if (stateEnum.getState() == state){
                return stateEnum;
            }
        }
        return null;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }
}
